import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sainbainu/common/values/colors.dart';

const double _boxSize = 65.0;
const double _boxRadius = 5.0;

class ManageCard extends StatelessWidget {
  final void Function() onTap;
  const ManageCard({super.key, required this.onTap});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: SizedBox(
        width: _boxSize,
        height: _boxSize + 20,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            _buildCoverArea(),
            Text(
              '小组管理'.tr,
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: const TextStyle(
                color: AppColors.active,
                fontSize: 12,
                fontWeight: FontWeight.w500,
              ),
            )
          ],
        ),
      ),
    );
  }

  /// 头部区域
  Widget _buildCoverArea() {
    return Container(
      width: _boxSize,
      height: _boxSize,
      decoration: BoxDecoration(
        border: Border.all(color: Colors.white, width: 3),
        borderRadius: BorderRadius.circular(_boxRadius),
        color: AppColors.unactive5,
      ),
      child: const Icon(
        Icons.people_outline_rounded,
        color: Colors.white,
        size: 34,
      ),
    );
  }
}
